package com.example.demo.controller;

import com.example.demo.entity.SysJob1;
import com.example.demo.mapper.SysJob1Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2023-09-24
 */
@Controller
@RequestMapping("/sysJob1")
public class SysJob1Controller {
    @Autowired
    SysJob1Mapper sysJob1Mapper;
    @RequestMapping("/add")
    @ResponseBody
    public int add(){
        SysJob1 entity = new SysJob1();
        entity.setJobName("2");
        entity.setJobGroup("2");
        entity.setJobGroup("2");
        Integer result = sysJob1Mapper.insert(entity);
        return result;
    }
    @RequestMapping("/update")
    @ResponseBody
    public int update(){
        SysJob1 entity = new SysJob1();
        entity.setJobId(1695537215134L);
        entity.setJobName("2");
        entity.setJobGroup("2");
        entity.setJobGroup("2");
        Integer result = sysJob1Mapper.update(entity);
        return result;
    }
    @RequestMapping("/get")
    @ResponseBody
    public String get(){
        SysJob1 entity = new SysJob1();
        entity.setJobId(1695537215134L);
        SysJob1 result= sysJob1Mapper.getById(entity);
        return result.toString();
    }
    @RequestMapping("/get2")
    @ResponseBody
    public String get2(){
        SysJob1 entity = new SysJob1();
        entity.setJobId(1695540257476L);
        SysJob1 result= sysJob1Mapper.getById2(entity);
        return result.toString();
    }
    @RequestMapping("/delete")
    @ResponseBody
    public int delete(){
        SysJob1 entity = new SysJob1();
        entity.setJobId(1695537215134L);
        Integer result = sysJob1Mapper.deleteById(entity);
        return result;
    }
}
